#!/usr/local/bin/python3
# -*- coding: UTF-8 -*-
"""
@author:apple
@file:setting.py
@time:2021/08/20
"""

LOGGING_CONFIGER = {
    "version": 1,
    "disable_existing_loggers": False,
    "formatters": {
        "simple": {
            "format": '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
        }
    },

    "handlers": {
        "console": {
            "class": "logging.StreamHandler",
            "level": "DEBUG",
            "formatter": "simple",
            "stream": "ext://sys.stdout"
        },

        "info_file_handler": {
            "class": "logging.handlers.RotatingFileHandler",
            "level": "INFO",
            "formatter": "simple",
            "filename": "info.log",
            "maxBytes": 10485760,
            "backupCount": 20,
            "encoding": "utf8"
        },

        "error_file_handler": {
            "class": "logging.handlers.RotatingFileHandler",
            "level": "ERROR",
            "formatter": "simple",
            "filename": "errors.log",
            "maxBytes": 10485760,
            "backupCount": 20,
            "encoding": "utf8"
        }
    },

    "loggers": {
        "console": {
            "level": "INFO",
            "handlers": ["console"],
            "propagate": False
        },
        "": {
            "level": "INFO",
            "handlers": ["console", "info_file_handler", "error_file_handler"],
            "propagate": False
        }
    },
}

